<?php
require_once 'init.php';

$page = cf\api\page\get('main');
$smarty->assign('pageText',cf\api\page\getText($page['id']));
$pageId = $page['id'];

$smarty->assign('name',$page['name']);
$smarty->assign('title',$page['title']);
$smarty->assign('keywords',$page['keywords']);
$smarty->assign('descr',$page['descr']);

$smarty->assign(
	'news',
	cf\query2arrays("
		SELECT IFNULL(code,cf_news.id) AS id,  DATE_FORMAT(dt,'%d.%m.%Y') as date, name, short_txt 
		FROM cf_news
		ORDER BY dt DESC
		LIMIT 2"
	)
);

$smarty->assign('projects', cf\api\page\getTree('projects',false,1));

$smarty->display('index.tpl');
?>
